<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
        <title>新建编程题</title>
        <include file='Layout:ins_css' />
        <style type="text/css">
            #addBtn {
                float: right;
                margin: -7px -6px 9px;
            }
            .cyf-inpput{
                height: 40px;
                font-size: 16px;
                border-radius: 3px;
                /*margin-bottom: 15px;*/
            }
            .cyf-label{
                height: 40px;
                font-size: 16px;
                margin-top: 6px;
            }
            .cyf-col{
                padding-left: 0;
                padding-right: 0;
            }
            .cyf-col select{
                height: 40px;
                padding: 0 45%;
            }
            .choose-tools{
                height: 41px;
                border-color: #edf1f2;
                background-color: #f6f8f8;
                color: #333;
                font-weight: 700;
                border-radius: 2px 2px 0 0;
                padding: 15px 15px 3px 15px;
                border-bottom: 1px solid transparent;
                display: block;
                clear: both;
            }
        </style>
    </head>
    <body>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>新建编程题</h5>
                            <button class="btn btn-primary" id="addBtn">新增</button>
                        </div>
                        <div class="ibox-content">
                            <form class="form-horizontal" id="form">
                                <div class="form-group cyf-form-group" >
                                    <div class="col-sm-5 col-sm-offset-4">
                                        <label style="float: left" class="col-sm-3 cyf-label">课程: </label>
                                        <div class="col-sm-8 col-xs-11 cyf-col">
                                            <select class="form-control col-sm-" id="college_id" name="college_id" style="min-height: 35px">
                                                <option value="0">全部</option>
                                                <volist name="college_info" id="college_info">
                                                    <option value="{$college_info.sch_id}">{$college_info.sch_name}</option>
                                                </volist>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group cyf-form-group" >
                                    <div class="col-sm-5 col-sm-offset-4">
                                        <label style="float: left" class="col-sm-3 cyf-label">知识点: </label>
                                        <div class="col-sm-8 col-xs-11 cyf-col">
                                            <select class="form-control col-sm-" id="" name="" style="min-height: 35px">
                                                <option value="0">全部</option>
                                                <volist name="college_info" id="college_info">
                                                    <option value="{$college_info.sch_id}">{$college_info.sch_name}</option>
                                                </volist>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group cyf-form-group" >
                                    <div class="col-sm-5 col-sm-offset-4">
                                        <label style="float: left" class="col-sm-3 cyf-label">习题号: </label>
                                        <div class="col-sm-8 col-xs-11 cyf-col">
                                            <input type="text" placeholder="" class="form-control cyf-inpput">
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group cyf-form-group" >
                                    <div class="col-sm-5 col-sm-offset-4">
                                        <label style="float: left" class="col-sm-3 cyf-label">难度: </label>
                                        <div class="col-sm-8 col-xs-11 cyf-col">
                                            <select class="form-control col-sm-" id="" name="" style="min-height: 35px">
                                                <option value="0">全部</option>
                                                <volist name="college_info" id="college_info">
                                                    <option value="{$college_info.sch_id}">{$college_info.sch_name}</option>
                                                </volist>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group cyf-form-group" >
                                    <div class="col-sm-5 col-sm-offset-4">
                                        <label style="float: left" class="col-sm-3 cyf-label">题库: </label>
                                        <div class="col-sm-8 col-xs-11 cyf-col">
                                            <select class="form-control col-sm-" id="" name="" style="min-height: 35px">
                                                <option value="0">- 请选择 - </option>
                                                <option value="1">练习题</option>
                                                <option value="2">测试题</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group cyf-form-group" >
                                    <div class="col-sm-5 col-sm-offset-4">
                                        <label style="float: left" class="col-sm-3 cyf-label">内容: </label>
                                        <div class="col-sm-9 col-xs-11 cyf-col">
                                            <textarea name="" id="" class="form-control  cyf-inpput removeData" rows="" cols="" style="height: 100px;"></textarea>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group cyf-form-group" >
                                    <div class="col-sm-5 col-sm-offset-4">
                                        <label style="float: left" class="col-sm-3 cyf-label">初始代码: </label>
                                        <div class="col-sm-9 col-xs-11 cyf-col">
                                            <textarea name="" id="" class="form-control  cyf-inpput removeData" rows="" cols="" style="height: 100px;"></textarea>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group cyf-form-group" >
                                    <div class="col-sm-5 col-sm-offset-4">
                                        <label style="float: left" class="col-sm-3 cyf-label">输入输出说明: </label>
                                        <div class="col-sm-9 col-xs-11 cyf-col">
                                            <textarea name="" id="" class="form-control  cyf-inpput removeData" rows="" cols="" style="height: 100px;"></textarea>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group cyf-form-group" >
                                    <div class="col-sm-5 col-sm-offset-4">
                                        <label style="float: left" class="col-sm-3 cyf-label">输入1: </label>
                                        <div class="col-sm-9 col-xs-11 cyf-col">
                                            <textarea name="" id="" class="form-control  cyf-inpput removeData" rows="" cols="" style="height: 100px;"></textarea>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group cyf-form-group" >
                                    <div class="col-sm-5 col-sm-offset-4">
                                        <label style="float: left" class="col-sm-3 cyf-label">输出1: </label>
                                        <div class="col-sm-9 col-xs-11 cyf-col">
                                            <textarea name="" id="" class="form-control  cyf-inpput removeData" rows="" cols="" style="height: 100px;"></textarea>
                                        </div>
                                    </div>
                                </div>
                            </form>
                            <div class="row choose-tools" style="height: auto;text-align: center" >
                                <div class="col-sm-1 col-sm-offset-4 col-xs-12">
                                    <button  class="btn btn-primary" id="subBtn" type="button">保存</button>
                                </div>
                                <div class="col-sm-2 col-xs-12">
                                    <button  class="btn btn-primary" id="addPrograme" type="button">继续添加输入输出</button>
                                </div>
                                <div class="col-sm-1 col-xs-12">
                                    <button   class="btn btn-white" id="cancelBtn" type="button">取消</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <include file='Layout:ins_js' />
        <script type="text/javascript">
            var index = 2;
            $(document).ready(function () {

                //自检
                check_index();

                $('#addPrograme').on('click',function () {

                    var content_in = "<div class='form-group cyf-form-group' >";
                    content_in += " <div class='col-sm-5 col-sm-offset-4'>" ;
                    content_in += "     <label style='float: left' class='col-sm-3 cyf-label'>输入" + index + " : </label>";
                    content_in += "     <div class='col-sm-9 col-xs-11 cyf-col'> <textarea name='' id='' class='form-control  cyf-inpput removeData' rows='' cols='' style='height: 100px;'></textarea> ";
                    content_in += " </div>";
                    content_in += "</div>";

                    var content_out = "<div class='form-group cyf-form-group' >";
                    content_out += " <div class='col-sm-5 col-sm-offset-4'>" ;
                    content_out += "     <label style='float: left' class='col-sm-3 cyf-label'>输出" + index + " : </label>";
                    content_out += "     <div class='col-sm-9 col-xs-11 cyf-col'> <textarea name='' id='' class='form-control  cyf-inpput removeData' rows='' cols='' style='height: 100px;'></textarea> ";
                    content_out += " </div>";
                    content_out += "</div>";
                    index++;
                    $('#form').append(content_in);
                    $('#form').append(content_out);
                });
            });
        </script>
    </body>
</html>